<?php

$directories = array(
	'components',
	'controllers',
);

foreach ($directories as $directory) {
	foreach (new FilesystemIterator($directory, FilesystemIterator::SKIP_DOTS) as $fileInfo) {
		$fileRealPath = $fileInfo->getRealPath();
		
		// skip folders
		if (!is_file($fileRealPath)) continue;
		
		require_once $fileRealPath;
	}
}